import styled from 'styled-components'
import border from '@a/styled/border'
import ellipsis from '@a/styled/ellipsis'

const Container = styled.div `
  header {
    height: .44rem;
    line-height: .44rem;
    text-align: center;
    font-size: .16rem;
    color: #fff;
    background-color: #ee742f;
  }
`

// padding-bottom 可以后台获取宽高比
const SwiperWrap = styled.div `
  height: 0;
  font-size: 0;
  padding-bottom: 66.66667%; 
  position: relative;
  color: #00afc7;
  .custom-carousel {
    position: static !important;
    .am-carousel-wrap {
      position: absolute;
      right: 5%;
      bottom: 14px;
      text-align: right;
    }
  }
`

const H1Container = border(styled.h1`
  height: .5rem;
  line-height: .5rem;
  padding: 0 .15rem;
  color: #666;
  // border-bottom: 1px solid #ccc;
`)

const HotCateWrap = styled.div `
  padding-bottom: .12rem;
  background: #fff;
  // h1 {
  //   height: .5rem;
  //   line-height: .5rem;
  //   padding: 0 .15rem;
  //   color: #666;
  //   border-bottom: 1px solid #ccc;
  // }
  .am-flexbox:last-child .am-flexbox-item:last-child {
    div {
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
  .grid-item {
    img {
      width: .54rem;
      height: .54rem;
      border-radius: .06rem;
      &[src="blank"] {
        display: none;
      }
    }
    div {
      margin-top: 4px;
      color: #888;
      font-size: 14px;
    }
  }
`

const SubTitle = ellipsis(
  styled.p``
)

const Top10Wrap = styled.div `
  h1 {
    height: .5rem;
    line-height: .5rem;
    padding: 0 .15rem;
    color: #666;
  }
  ul {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    padding-left: .1rem;
    li {
      width: 50%;
      padding-right: .1rem;
      margin-bottom: .1rem;
      img {
        width: 100%;
      }
      > div:last-child {
        display: flex;
        justify-content: center;
        flex-direction: column;
        align-items: center;
        height: .6rem;
        text-align: center;
        background: #fff;
        h3 {
          font-size: .16rem;
          color: #333;
        }
        span:last-child {
          margin-left: .06rem; 
        }
      }
    }
  }
`

export {
  Container,
  SwiperWrap,
  HotCateWrap,
  Top10Wrap,
  H1Container,
  SubTitle
}